'use strict';
const os = require('os');
const bootstrap = require('./_app.js');
const config = bootstrap.getAppConfig();
const app = bootstrap.createApplication();
config.easyMonitor && config.easyMonitor.needStart && require('easy-monitor')(config.easyMonitor);

// 启动服务器
let logo = '\n';
logo += '   __ _       _     _                   ' + '\n';
logo += '  / /(_) __ _| |__ | |_  /\\/\\__   _____ ' + '\n';
logo += ' / / | |/ _` | \'_ \\| __|/    \\ \\ / / __|' + '\n';
logo += '/ /__| | (_| | | | | |_/ /\\/\\ \\ V | (__ ' + '\n';
logo += '\\____|_|\\__, |_| |_|\\__\\/    \\/\\_/ \\___|' + '\n';
logo += '        |___/                           ' + '\n';

app.listen(config.serverPort, () => {
    console.log(logo + 'started at ' + os.hostname() + ':' + config.serverPort + '.\n');
    bootstrap.startTspClient(); // 启动TSP客户端
});